﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Strings
{
    class Program
    {
        static void Main(string[] args)
        {
            //string mystring = string.Format("My name is {0}. Nice to meet you {1}","Phi","World");
            //string mystring = string.Format("{0:c}", 123.52);//xuat $123.52
            //string mystring = string.Format("{0:N}", 123456789);//xuat 123,456,789.00
            //string mystring = string.Format("{0:P}", 0.00123);//xuat 0.12 %

            //string mystring = "";
            //for (int i = 0; i < 100; i++)
            //{
            //    mystring += "-->" + i.ToString();
            //}

            //StringBuilder mystring = new StringBuilder();
            //for (int i = 0; i < 100; i++)
            //{
            //    mystring.Append("-->");
            //    mystring.Append(i);
            //}

            string mystring = "   Chao the gioi, minh ten phi     ";

            //mystring = mystring.Substring(5, 8);
            //mystring = mystring.ToUpper();
            //mystring = mystring.Replace(" ", "___");
            mystring = string.Format("Length before: {0} -- After: {1}", 
                mystring.Length, mystring.Trim().Length);

            Console.WriteLine(mystring);
            Console.ReadLine();
        }
    }
}
